package vn.aptech.leaveManagementSystem.view.general;

import javax.swing.JOptionPane;

import vn.aptech.leaveManagementSystem.business.dto.UserLoginInfo;
import vn.aptech.leaveManagementSystem.view.DemoLgFr;

public class General {
	private Object mainform;
	public General() {
		
	}
	
	public void exit()
	{
		int choosen=JOptionPane.showOptionDialog(null, "Do you want to exit?", "Warning!",JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, null, null);
		if (choosen==JOptionPane.OK_OPTION)
		{
			System.exit(0);
		}
	}
	
	public void logout()
	{
		int choosen=JOptionPane.showOptionDialog(null, "Do you want to Logout?", "Warning!",JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, null, null);
		if (choosen==JOptionPane.OK_OPTION)
		{
			UserLoginInfo.setUserInfo(null);
			DemoLgFr login=new DemoLgFr();
			login.setVisible(true);
		}
	}
	
	public void changPassword(int idEmp)
	{
		DemoChangePassword changepass=new DemoChangePassword(idEmp);
		changepass.setVisible(true);
		changepass.setAlwaysOnTop(true);
	}
}
